package com.apes.auto.car.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.scm.masterdata.area.model.Country;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @ClassName CarThumbnail
 * @Description TODO
 * @Author pengyb
 * @Date 2019/7/31 16:07
 * @Version 1.0
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = CarThumbnail.CONST_TABLE_NAME, indexes = {
        @Index(columnList = "PZCX_ID")
})
public class CarThumbnail extends BaseModel {
    public static final String CONST_TABLE_NAME = "dc_car_thumbnail";
    @Id
    @Column(name = "id", length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "车型缩略表")
    private String id;

    @Column(name = "PZCX_ID", length = 32)
    @Comment("车型ID")
    private String PZCXID;

    @Column(name = "level_ID", length = 32)
    @Comment("levelID")
    private String levelID;

    @NotNull
    @Comment("品牌")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "QCPP_ID", referencedColumnName = "id")
    private CarBrand carBrand;

    @NotNull
    @Comment("厂商")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "QCCS_ID", referencedColumnName = "id")
    private Manufacturers manufacturers;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CXI_ID", referencedColumnName = "id")
    @Comment("车系")
    private CarSeries carSeries;


    @Column(name = "level_car_type", length = 64)
    @Comment("力洋车型")
    private String levelCarType;  //力洋车型

    @Column(name = "LEVEL_DWSL", length = 22)
    @Comment("档位数(力洋)")
    private String LEVELDWSL;

    @Column(name = "LEVEL_FDJXH", length = 64)
    @Comment("发动机型号(力洋)")
    private String LEVELFDJXH;

    @Column(name = "XSBB", length = 32)
    @Comment("销售版本")
    private String XSBB;

    @Column(name = "CHXXSMC", length = 64)
    @Comment("销售名称")
    private String CHXXSMC;

    @Column(name = "NK", length = 4)
    @Comment("年款")
    private Integer NK;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PFBZID", referencedColumnName = "id")
    @Comment("排放标准")
    private AutoEmissionStandard emissionStandard;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "QCLX_ID", referencedColumnName = "id")
    @Comment("汽车类型")
    private AutoCategory carType;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "QCDJ_ID", referencedColumnName = "id")
    @Comment("汽车等级")
    private AutoLevel carLevel;

    @Column(name = "XSZDJ", length = 32)
    @Comment("指导价【万元】")
    private String XSZDJ;

    @Column(name = "SSNF", length = 4)
    @Comment("上市年份")
    private Integer SSNF;

    @Column(name = "SSYF", length = 2)
    @Comment("上市月份")
    private Integer SSYF;

    @Column(name = "TCNF", length = 4)
    @Comment("停产年份")
    private String TCNF;

    @Column(name = "SCZT", length = 4)
    @Comment("生产状态")
    private String SCZT;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GB_ID", referencedColumnName = "id")
    @Comment("国别")
    private Country country; //国家

    //    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "YJFS", referencedColumnName = "id")
//    @Comment("引进方式")
//    private Enumeration YJFS;//类别(carCategory)(0:国产;1：进口;2：合资)
    @Column(name = "YJFS", length = 16)
    @Comment("引进方式")
    private String YJFS;

    @Column(name = "FDJXH", length = 128)
    @Comment("发动机型号")
    private String FDJXH;

    @Column(name = "FDJMS", length = 200)
    @Comment("发动机描述")
    private String FDJMS;

    @Column(name = "BSXLB", length = 16)
    @Comment("变速器类型")
    private String BSXLB;


    @Column(name = "BSQMS", length = 200)
    @Comment("变速器描述")
    private String BSQMS;

    @Column(name = "QGRJ", length = 16)
    @Comment("气缸容积")
    private String QGRJ;

    @Column(name = "MQGQMSL", length = 8)
    @Comment("每气缸气门数")
    private Integer MQGQMSL;

    @Column(name = "QGPLXS", length = 16)
    @Comment("气缸排列形式")
    private String QGPLXS;

    @Column(name = "QGSL", length = 2)
    @Comment("气缸数")
    private Integer QGSL;

    @Column(name = "FDJPL", length = 16)
    @Comment("排量")
    private String FDJPL;

    @Column(name = "JQXS", length = 32)
    @Comment("进气形式")
    private String JQXS;

    @Column(name = "RLLX", length = 16)
    @Comment("燃料类型")
    private String RLLX;

    @Column(name = "RLBH", length = 16)
    @Comment("燃油标号")
    private String RLBH;

    @Column(name = "ZDML", length = 16)
    @Comment("最大马力【ps】")
    private String ZDML;

    @Column(name = "ZDGL", length = 16)
    @Comment("最大功率【kw】")
    private String ZDGL;


    @Column(name = "QZDQLX", length = 200)
    @Comment("前制动器类型")
    private String QZDQLX;


    @Column(name = "HZDQLX", length = 200)
    @Comment("后制动器类型")
    private String HZDQLX;


    @Column(name = "ZLLX", length = 200)
    @Comment("助力类型")
    private String ZLLX;


    @Column(name = "FDJWZ", length = 32)
    @Comment("发动机位置")
    private String FDJWZ;


    @Column(name = "QDFS", length = 32)
    @Comment("驱动方式")
    private String QDFS;


    @Column(name = "CSXS", length = 32)
    @Comment("车身形式")
    private String CSXS;


    @Column(name = "ZHOUJ", length = 32)
    @Comment("轴距【mm】")
    private String ZHOUJ;


    @Column(name = "CMS", length = 16)
    @Comment("车门数")
    private String CMS;   //“两门”改为“二门”


    @Column(name = "ZWSL", length = 16)
    @Comment("座位数【个】")
    private String ZWSL;


    @Column(name = "QLTGG", length = 32)
    @Comment("前轮胎规格")
    private String QLTGG;

    @Column(name = "HLTGG", length = 32)
    @Comment("后轮胎规格")
    private String HLTGG;

    @Column(name = "QLGGG", length = 32)
    @Comment("前轮毂规格")
    private String QLGGG;

    @Column(name = "HLGGG", length = 32)
    @Comment("后轮毂规格")
    private String HLGGG;

    @Column(name = "LGCL", length = 32)
    @Comment("轮毂材料")
    private String LGCL;

    @Column(name = "BTGG", length = 32)
    @Comment("备胎规格")
    private String BTGG;

    @Column(name = "DDTC", length = 32)
    @Comment("电动天窗")
    private String DDTC;

    @Column(name = "QJTC", length = 32)
    @Comment("全景天窗")
    private String QJTC;

    @Column(name = "XQDD", length = 32)
    @Comment("氙气大灯")
    private String XQDD;

    @Column(name = "QWD", length = 32)
    @Comment("前雾灯")
    private String QWD;

    @Column(name = "HYS", length = 32)
    @Comment("后雨刷")
    private String HYS;

    @Column(name = "KT", length = 8)
    @Comment("空调")
    private String KT;

    @Column(name = "ZDKT", length = 8)
    @Comment("自动空调")
    private String ZDKT;
}
